package com.n9.buymsg.view;

import com.n9.buymsg.AppContext;
import com.n9.buymsg.event.AppEvent;
import com.n9.buymsg.event.Callback;

import javax.swing.*;

/**
 * 自定义命令组件
 */
public class EventComponent extends JFrame {
    public void publishEvent(AppEvent event) {
        publishEvent(event, null);
    }
    public void publishEvent(AppEvent event, Callback callback) {
        AppContext.getInstance().publishEvent(event);
    }

    public void showErrorDialog(String title, String msg) {
        DialogUtils.showError(this, title, msg);
    }
}
